package org.example.order.VO;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Pattern;

import java.util.Date;

@Data
public class AdminVO {

    private Long id;

    @Size(max = 64, message = "用户名长度不能超过64个字符")
    private String username;

    // 密码一般不返回VO，若需要校验可添加

    @Size(max = 128, message = "密码长度不能超过128个字符")
    private String password;


    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    @Size(min = 11, max = 11, message = "手机号长度必须为11位")
    private String phone;

    @Min(value = 0, message = "状态值不正确")
    @Max(value = 1, message = "状态值不正确")
    private Integer status;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date lastLoginTime;

    @Size(max = 64, message = "最后登录IP长度不能超过64个字符")
    private String lastLoginIp;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    @Size(max = 32, message = "令牌长度不能超过32个字符")
    private String token;
}